package com.example.smartcity.activity;

import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.example.smartcity.R;

public class AdviceContentActivity extends AppCompatActivity {
    TextView tv_advice_content;
    TextView tv_advice_content_person;
    TextView tv_advice_content_reply;
    String username;
    String content;
    String reply;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_advice_content);
        Intent intent = getIntent();

        // 从Intent中获取数据
        username = intent.getStringExtra("username");
        Log.i("username", "onCreate: " + username);
        content = intent.getStringExtra("content");
        Log.i("content", "onCreate: " + content);
        reply = intent.getStringExtra("reply");
        Log.i("reply", "onCreate: " + reply);
        initView();
        tv_advice_content.setText(content);
        tv_advice_content_person.setText(username);
        if(reply==""||reply==null){
            tv_advice_content_reply.setText("暂无回复");
        }else{tv_advice_content_reply.setText(reply);}
    }
    private void initView(){
        tv_advice_content = findViewById(R.id.advice_content);
        tv_advice_content_person = findViewById(R.id.advice_content_person);
        tv_advice_content_reply = findViewById(R.id.advice_content_reply);
    }
}